<?php
abstract class AbstractPrefixClass{
  // 抽象方法仅需要定义需要的参数
  abstract protected function prefixName($name);
}
class PrefixConcreteClass extends AbstractPrefixClass{
  // 子类可以定义父类方法签名中不存在的参数
  public function prefixName($name,$separator=".")
  {
    if($name=="Pacman"){
      $prefix="Mr";
    }elseif($name=="Pacwoman"){
      $prefix="Mrs";
    }else{
      $prefix="";
    }
    return "{$prefix}{$separator}{$name}";
  }
}
$class=new PrefixConcreteClass();
echo $class->prefixName("Pacman"),"\n";
echo $class->prefixName("Pacwoman"),"\n";
?>